fix(player): own connection and media resources#2152
Conversation
601af15 to
ab96a94
Compare
7bb3529 to
a9f9e40
Compare
ab96a94 to
720a1ed
Compare
cb38f96 to
5b28eec
Compare
1fcffa3 to
e7cec75
Compare
9c7bf71 to
d0969c4
Compare
8eca5d7 to
aeca7e3
Compare
29caf12 to
b6a53a4
Compare
7b49c3c to
b720c3f
Compare
b6a53a4 to
65c4a72
Compare
b720c3f to
edd75b5
Compare
65c4a72 to
d80edef
Compare
edd75b5 to
cc3ca2f
Compare
d80edef to
0220c21
Compare
0220c21 to
16942c0
Compare
james-russo-rames-d-jusso
left a comment
There was a problem hiding this comment.
Clean ownership boundary — OwnedMediaRegistry replaces the fragile dataset.hfSlideshowMediaSync marker with AbortController-per-binding, and the 10-cycle reconnect test pins the idempotence contract cleanly. The el.ownerDocument.defaultView?.AbortController ?? AbortController fallback for cross-realm iframe media is a nice touch.
Nits
packages/player/src/slideshow/hyperframes-slideshow.ts:1170—stopDocumentMedianow stops only owned media, not document-wide. The name is left over from the oldownerDocument.querySelectorAllimplementation. ConsiderstopOwnedMedia(or similar) to match the registry's actual scope. Trivial; ignore if you'd rather keep the internal API stable.packages/player/src/slideshow/hyperframes-slideshow.ts:1163-1174—updateMutedStateandstopDocumentMediaboth callownedMedia.sync(...)directly instead of routing throughwireSlideshowMedia(). If a new element gets picked up byupdateMutedState's call, its initial mute state is applied by the immediately-followingsetMuted(muted)(bounded set, single-threaded — safe), but theadded-mute path fromwireSlideshowMediais duplicated. Consistent as-is; flagging in case you'd rather have one entry point.
What I didn't verify
- Cross-realm
AbortControllerbehavior in Firefox / older Safari — trusting the pattern generalizes to your target matrix. - Whether any consumer outside
packages/playerrelied on the old page-wide mute/pause semantics of<hyperframes-slideshow>. Workspace grep turned up none; the PR body explicitly calls the scope reduction a fix.
miguel-heygen
left a comment
There was a problem hiding this comment.
Independent bottom-layer review on 16942c0c.
- Reconnect teardown/recreation is symmetric for controls and parent media (
packages/player/src/hyperframes-player.ts:179,:192). - The registry uses owner-realm AbortControllers and aborts removed/disconnected bindings (
packages/player/src/slideshow/owned-media-registry.ts:35,:46,:67). - Scope tests cover two slideshows plus unrelated page media (
packages/player/src/slideshow/hyperframes-slideshow.test.ts:397).
Rames already covered the naming/entry-point nits; I found no additional correctness gap. Current required checks are green.
Verdict: APPROVE
Reasoning: Resource ownership is bounded to the component, teardown is deterministic, and reconnect/scope regressions are directly tested.
— Home
Merge activity
|
miguel-heygen
left a comment
There was a problem hiding this comment.
Re-reviewed the merged head 16942c0c12fab7e87876fa253432e29d85835db4. There is no new code delta since my approval, and the completed required checks are green. I found no post-merge correctness issue. The earlier naming / duplicate sync-entry-point notes remain optional cleanup only.
Verdict: COMMENT (post-merge: Ready)
Reasoning: Same approved head, green required CI, and no newly discovered blocker.
— Magi
miguel-heygen
left a comment
There was a problem hiding this comment.
Final freshness check on merged head 16942c0c12fab7e87876fa253432e29d85835db4.
The reviewed commit is unchanged, the player-ownership boundary remains clean, and the complete required check set is green. No post-merge regression or new review finding surfaced.
Verdict: COMMENT (post-merge ready)
Reasoning: The merged implementation remains sound and fully green; there is no actionable follow-up from this pass.
— Deepwork

What
Make Player connection resources symmetric and scope slideshow media ownership.
Why
Reconnect could retain destroyed handles, while slideshow operations scanned and mutated unrelated document media.
How
Null and recreate connection-owned resources idempotently and introduce an OwnedMediaRegistry with abortable cleanup.
Test plan